
import initMap from "./init";
import BaseAnimateWall from "./wall";
const Cesium = window.Cesium;
export default class CesMap {
    el;
    viewer;
    constructor(el) {
        this.el = el;

        this.init()
    }
    init = () => {
        this.viewer = new initMap(this.el)
    };

    createWall = (ps, color = [255, 6, 255]) => {

        new BaseAnimateWall(
            this.viewer,
            ps,
            120,
            new Cesium.Color.fromCssColorString(`rgba(${color[0]},${color[1]},${color[2]}, 1.0)`),
            1000
        )
    }
    setView = (sub) => {
        const { position, angle } = sub;
        this.viewer.camera.flyTo({
            destination: Cesium.Cartesian3.fromDegrees(...position),
            orientation: {
                heading: angle[0],
                pitch: angle[1],//从上往下看为-90
                roll: angle[2]
            },
            duration: 3,
        });
    }

}